<?php
/*
 *author:Yangligao
 *Date:2013-9-23
 */
require 'Config.php';

$userName = $_POST['username'];
$userPwd = $_POST['userpwd'];
$verify = strtolower($_POST['verify']);
if($_SESSION['verify'] == $verify){
	
	$userModel = new UserModel();
	$res = $userModel->user_select($userName);
	if($res[0]['user_pwd'] == md5($userPwd)){
		$_SESSION['user_name'] = $userName;
		$_SESSION['loginFlag'] = 1;
		jump('登录成功！', 'index.php');
	}	
}else{
	
	echo "<script type='text/javascript'>alert('验证码不正确！');location.href='".$_SERVER['HTTP_REFERER']."';</script>";
}
?>
